package theOrbalEra.client.OrbalArts.render;

import org.lwjgl.opengl.GL11;

import theOrbalEra.client.ClientProxy;
import theOrbalEra.client.OrbalArts.entity.OrbalArtEntityFlameArrow;
import theOrbalEra.client.OrbalArts.model.ModelCylinder;
import theOrbalEra.common.util.DefultValue;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelCreeper;
import net.minecraft.entity.Entity;

public class OrbalRenderFlameArrow extends OrbalRenderOrbalArt {
	private ModelCylinder baseModel = new ModelCylinder();
	@Override
	public void doRender(Entity entity, double d0, double d1, double d2,
			float f, float f1) {
		renderFlameArrow(entity,d0,d1,d2,f,f1);

	}

	private void renderFlameArrow(Entity entity, double d0, double d1,
			double d2, float f, float f1) {
		OrbalArtEntityFlameArrow arrow=(OrbalArtEntityFlameArrow) entity;
		     GL11.glPushMatrix();
		     this.loadTexture(DefultValue.Texture_FireBolt);
		     GL11.glEnable(GL11.GL_CULL_FACE);
		     GL11.glEnable(GL11.GL_BLEND);
             GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
             GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.3F);
             GL11.glTranslatef((float)d0, (float)d1, (float)d2);
             if(arrow.angleType!=-1){
            	 switch (arrow.angleType) {
					case 0:
						GL11.glRotatef(45F, 1F, 0, 0);
						break;
					case 1:
						 GL11.glRotatef(-45F, 1F, 0, 0);
						 break;
					case 2:
						 GL11.glRotatef(45F, 0, 0, 1F);
						 break;
					case 3:
						 GL11.glRotatef(-45F, 0, 0, 1F);
						 break;

					default:
						break;
				}
   	 
             }
             
             baseModel.renderAll();
		     GL11.glDisable(GL11.GL_BLEND);
		     GL11.glDisable(GL11.GL_CULL_FACE);
	
		    GL11.glPopMatrix();
		
		
	}

}
